package com.shuyuansystem.controller;

import com.shuyuansystem.pojo.User;
import com.shuyuansystem.service.OrderMessageService;
import com.shuyuansystem.utils.ValidateCodeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.mail.MessagingException;

@RestController
@RequestMapping("/ValidateCode")
public class ValidateCodeController {
    @Autowired
    private OrderMessageService orderMessageService;
    @RequestMapping("/ValidateCode.do")
    public boolean ValidateCode(@RequestBody User user) throws MessagingException {
        orderMessageService.sendMail(user.getEmail());
        System.out.println("邮件发送成功");
        return true;


}
}
